<include file="public:head" />


<div class="layui-container fly-marginTop">
  <div class="fly-panel fly-panel-user" pad20>
    <div class="layui-tab layui-tab-brief" lay-filter="user">
      <ul class="layui-tab-title">
        <li class="layui-this">登入</li>
        <li><a href="{:U('user/register')}">注册</a></li>
      </ul>
      <div class="layui-form layui-tab-content" style="padding: 20px 0; min-height:500px">
        <div class="layui-tab-item layui-show">
          <div class="layui-form layui-form-pane">
            <form class="layui-form" method="post" >
              <input type="hidden" name="refer" value="{$refer}"/>
              <input type="hidden" name="ret_url" value="{$ret_url}"/>
              <div class="layui-form-item">
                <label for="L_email" class="layui-form-label">用户名/邮箱</label>
                <div class="layui-input-inline">
                  <input type="text" class="layui-input" placeholder="用户名/邮箱" name="username"  >
                </div>
              </div>
              <div class="layui-form-item">
                <label for="L_pass" class="layui-form-label">登录密码</label>
                <div class="layui-input-inline">
                  <input type="password" id="password" name="password" placeholder="登录密码" required lay-verify="required" autocomplete="off" class="layui-input">
                </div>
              </div>
              <div class="layui-form-item">
                <button class="layui-btn" id="loginbtn">立即登录</button>
                <span style="padding-left:20px;">
                  <a href="forget.html">忘记密码？</a>
                </span>
              </div>
            </form>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
<script src="__PUBLIC__/theme/blueideal/layui/layui.js"></script> 
<script src="__PUBLIC__/theme/blueideal/layui/particles.min.js"></script> 
<script src="__PUBLIC__/theme/blueideal/layui/app.js"></script> 
<script type="text/javascript">
    layui.use(['form', 'layer'], function () {
        // 操作对象
        var form = layui.form, layer = layui.layer, $ = layui.jquery;

        $('#loginbtn').on('click',function(){
            var data = $("form").serialize();
            $.post("{:U('user/login')}",data,function(res){
                if(res.status ==  1){
                    layer.msg(res.msg,{time:1800},function(){
                        location.href = "{$ret_url}";
                    });
                }else{
                    layer.msg(res.msg,{time:1800});
                }
            });
            return false;
        }); 
    })
</script>